package com.piesat.quake.business.device.mqtt.param;

import java.lang.reflect.Field;
import java.util.List;
import java.util.function.Function;

public class ListParseParam extends ClassParseParam {

    private Function<String,Boolean> finishFunc;
    private Function<String,Integer> lengthFunc;

    public ListParseParam() {
    }

    public ListParseParam(Field field, Class<?> clazz, List<? extends ParseParam> parseParams, Function<String,Boolean> finishFunc) {
        super(field, 3);
        this.clazz = clazz;
        this.parseParams = parseParams;
        this.finishFunc=finishFunc;
    }

    public boolean isFinish(String field){
        return finishFunc.apply(field);
    }

    @Override
    public int getLength() {
        return super.getLength();
    }
}